<template>
	<app-layout>
		<view class="img" v-for="(item,index) in imglist" :key="index" @click="">
			<button open-type="share">
				<image :src="item.icon_url" mode="widthFix" style="width: 100%;"></image>
			</button>
		</view>
	</app-layout>
</template>

<script>
	export default {
		data() {
			return {
				imglist: [],
				indeximg: ''
			}
		},
		onLoad() {
			this.allReq()
			this.imgReq()
			uni.showShareMenu({
				menus: ['shareAppMessage', 'shareTimeline']
			})
		},
		onShareAppMessage() {
			return this.$shareAppMessage({
				title: '免费开自己的珠宝店,寻找适合自己的珠宝',
				path: '/pages/index/index',
				imageUrl: this.indeximg,
				params: {
					
				}
			});
		},
		onShareTimeline() {
			return this.$shareTimeline({
				title: '免费开自己的珠宝店,寻找适合自己的珠宝',
				query: {

				}
			});
		},
		methods: {
			allReq() {
				this.$request({
					url: this.$api.navs.list,
					data: {
						pid: 753,
						status: 1
					}
				}).then((res) => {
					this.imglist = res.data.list
				}).catch(() => {

				})
			},
			imgReq() {
				this.$request({
					url: this.$api.navs.list,
					data: {
						pid: 276,
						status: 1
					}
				}).then((res) => {
					this.indeximg = res.data.list[0].icon_url
				}).catch(() => {
			
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	button {
		padding: 0;
		margin: 0;
	}
</style>
